package cn.itcast.service.impl;

import cn.itcast.dao.MemberDao;
import cn.itcast.pojo.Member;
import cn.itcast.service.MemberService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service(version = "1.0.0")
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberDao memberDao;


    /**
     * 校验手机号是否注册的方法,根据手机号查询用户
     * @param phone
     * @return
     */
    @Override
    public Member findByTelephone(String phone) {
        return memberDao.findByTelephone(phone);
    }

    /**
     * 添加会员的方法
     * @param member
     */
    @Override
    public void add(Member member) {
        memberDao.add(member);
    }

    /**
     * 根据id查询会员的方法
     * @param id
     * @return
     */
    @Override
    public Member queryById(Integer id) {
        return memberDao.queryById(id);
    }
}
